const mongoose = require('mongoose')

const imageSchema = new mongoose.Schema({
  originalname: String,
  imagepath: {
    type: String, maxlength: 128, required: true
  },
  title: {
    type: String, maxlength: 128, required: true
  },
  description: {
    type: String, maxlength: 1024
  },
  views: {
    type: Number, default: 0
  },
  likes: {
    type: Number, default: 0
  }
}, {timestamps: true})

mongoose.model('Image', imageSchema, 'images')